import request from "@/utils/request";

// 传感器树查询
export function getSpaceListTree(data) {
  return request({
    url: "/api/logistics/Sensor/getListTree",
    method: "GET",
    data,
  });
}

// 传感器类型查询
export function getTypeList(data) {
  return request({
    url: "/api/logistics/BasSensorType/getList",
    method: "POST",
    data,
  });
}

// 传感器查询
export function getList(data) {
  return request({
    url: "/api/logistics/BasSensor/getList",
    method: "POST",
    data,
  });
}

// 传感器查询
export function getSensorList(data) {
  return request({
    url: "/api/logistics/BasSensor/getList",
    method: "POST",
    data,
  });
}

// 删除传感器
export const delSpace = (id) => {
  return request({
    url: `/api/logistics/Sensor/${id}`,
    method: "DELETE",
  });
};

// 新建传感器
export const createSpace = (data) => {
  return request({
    url: "/api/logistics/Sensor",
    method: "POST",
    data,
  });
};

// 修改传感器
export const updateSpace = (data) => {
  return request({
    url: `/api/logistics/Sensor/${data.id}`,
    method: "PUT",
    data,
  });
};

// 获取传感器
export const getSpace = (data) => {
  return request({
    url: `/api/logistics/Sensor/${data}`,
    method: "GET",
    data,
  });
};
